<template>
  <el-result
      icon="error"
      title="抱歉遇到一些错误！"
      :sub-title="subTital"
  >
    <template #extra>
      <el-button type="primary" @click="toIndex">返回首页</el-button>
    </template>
  </el-result>
</template>

<script>
import {ElLoading} from 'element-plus'

export default {
  name: "ErrorPage",
  props: ['msg', 'status'],
  computed: {
    subTital() {
      return "状态码为：" + this.status + "，错误提示为：" + this.msg
    }
  },
  created() {
    const loadingInstance = ElLoading.service({ fullscreen: true })
    loadingInstance.close()
  },
  methods: {
    toIndex() {
      this.$router.push({name: "index"})
      // this.$router.push({path: "/"})
    }
  }
}
</script>

<style scoped>

</style>